﻿using GwLib.UnitTesting;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace FourKillMvc.Services
{
    public class GameObject
    {
        public string ObjectId { get; set; }
        public int SpriteId { get; set; }
        public int ObjectTypeId { get; set; }
        public string Name { get;set; }
        public double Latitude { get; set; }
        public double Longitude { get; set; }
        public double BearingAngle { get;set; }
        public double LineOfSightAngle { get; set; }
    }

    public class PlayerSession : GameObject
    {
        public int SessionId { get; set; }
        public bool IsAuthenticated { get; set; }
        public int UserId { get; set; }
        public string RemoteHost { get; set; }
        public string UserAgent { get; set; }
    }

    public class PlayerLoginInfo
    {
        public bool IsAuthenticated { get; set; }
        public string Name { get; set; }
        public double Latitude { get; set; }
        public double Longitude { get; set; }
        public double BearingAngle { get; set; }
        public double LineOfSightAngle { get; set; }
    }

    public class GameService
    {
        public static TestStorage _db;

        public static TestStorage DB
        {
            get
            {
                if (_db != null)
                {
                    //_db.AddTrigger<PlayerSession>(PlayerId
                    
                }
                return null;
            }
        }

        public PlayerSession InitializeSession(PlayerLoginInfo loginInfo)
        {
            var session = new PlayerSession();
            //session.SessionId = session;
            //session.Name = playerName;
            return session;
        }

        public PlayerSession InitializeSession(int sessionId, string playerName, string password, double latitude, double longitude)
        {
            var session = new PlayerSession();
            session.SessionId = sessionId;
            session.Name = playerName;
            return session;
        }

        public List<GameObject> Update(int sessionId, string id, double latitude, double longitude)
        {
            return null;
        }
    }
}